package com.iamteer.service.impl;

import java.util.List;

import com.iamteer.dao.ICategoryDao;
import com.iamteer.entity.Category;
import com.iamteer.factory.BeanFactory;
import com.iamteer.service.ICategoryService;

public class CategoryService implements ICategoryService {
	private ICategoryDao categoryDao = BeanFactory.getInstance("categoryDao", ICategoryDao.class);
	
	@Override
	public void add(Category category) {
		categoryDao.add(category);
	}

	@Override
	public void update(Category category) {
		categoryDao.update(category);
	}

	@Override
	public void delete(int id) {
		categoryDao.delete(id);
	}

	@Override
	public Category findById(int id) {
		return categoryDao.findById(id);
	}

	@Override
	public List<Category> query() {
		return categoryDao.query();
	}

	@Override
	public List<Category> query(String keyword) {
		return categoryDao.query(keyword);
	}

	@Override
	public Integer getFirst() {
		return categoryDao.getFirst();
	}

}
